#pragma once

#include "Core.h"

bool operator < (const FILETIME &a, const FILETIME &b)
{
    if (a.dwHighDateTime < b.dwHighDateTime) {
        return true;   
    }
    else if (a.dwHighDateTime == b.dwHighDateTime) {
        return (a.dwLowDateTime < b.dwLowDateTime);
    }
    else {
        return false;
    }
}

bool operator == (const FILETIME &a, const FILETIME &b)
{
    return (a.dwHighDateTime == b.dwHighDateTime) && (a.dwLowDateTime == b.dwLowDateTime);
}

inline HFONT NewFont(LPCWSTR family, int ptHeight, HDC hdc)
{
    LOGFONT lf = { 0 };
    lf.lfHeight = -MulDiv(ptHeight, GetDeviceCaps(hdc, LOGPIXELSY), 72);
    lf.lfCharSet = ANSI_CHARSET;
    lf.lfWeight = FW_BOLD;
    StringCchCopy(lf.lfFaceName, LF_FACESIZE, family);
    return CreateFontIndirect(&lf);
}

inline int Width(const RECT &r) { return r.right - r.left; }
inline int Height(const RECT &r) { return r.bottom - r.top; }

